﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace 物流管理系统
{
    public partial class Transferinfo : Form
    {
        DBOperation dboperation = new DBOperation();
        ReMatch re = new ReMatch();
        public string carid;
        public Transferinfo()
        {
            InitializeComponent();
        }

        private void confirm_Click(object sender, EventArgs e)
        {
            if (!re.adressmatch(transferaddrtext.Text))
            {
                MessageBox.Show("中转地输入非法！！！\n格式为中英文和数字组成的2位以上地址。", "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }
            dboperation.nonquerysql("update 托运信息表 set 备注=concat(备注,'"+transferdatetimepicker.Value.ToString()+"：中转，中转地点："+transferaddrtext.Text+"；') where 托运编号 in (select 托运编号 from 装车信息表 where 车牌号='"+carid+"');");
            Close();
        }
    }
}